import list_behavior from "../../behavior/list_behavior";

const app = getApp()
const global = app.globalData

Page({
    behaviors:[list_behavior],
    data: {
        nav:{
            title:"",
            opacity:0
        },
        imageUrl:global.imageUrl,
    },
    onLoad: function (options) {
        this.init()
    },

    liClick(e){
        const {list} = this.data
        const {index} = e.currentTarget.dataset
        const item = list.items[index]
        if (item.time_status.status == 1){  // 只允许进行中的活动跳转详情页
            wx.navigateTo({
                url: `/pages/active/group_show?id=${item.id}`
            })
        }

    },

    init(){
        this.setData({
            [`list.url`]:"/listing/group",
            [`list.where`]:{
                time_status:1,
            }
        })
        this.setList(1)
    }
});
